package com.mvc.queue;
import org.springframework.web.context.request.async.DeferredResult;

import	java.util.Queue;
import java.util.concurrent.ConcurrentLinkedDeque;

public class JamesDefferdQueue {
    private static Queue<DeferredResult<Object>> queue = new ConcurrentLinkedDeque<DeferredResult<Object>>();//表示队列接收的存储类型为DeferredResult对象

    public static void save(DeferredResult<Object> deferredResult) {
        queue.add(deferredResult);//将对象加入对象
    }
    public  static DeferredResult<Object> get(){
        return queue.poll();//将对象从队列拿出并删除
    }
}
